package cn.ad.server.web.spring.service.actions.context;

/**
 * @author dongbin.yu
 * @from 2016-05-18
 * @since V1.0
 * 广告请求上下文
 */
public class AdContext implements Cloneable {
	
	/**
	 * 服务器标识
	 */
    private String serverId;

    /**
     * 请求时间戳
     */
    private long requestTimestamp;

    /**
     * 请求协议版本
     */
    private float version;

    /**
     * 请求接口调用方IP地址
     */
    private String requestIp;

    /**
     * 广告位标识
     */
    private long adSpaceId;

    private int mediaCategory;

    private int adFormat;

    private int adSpaceWidth;

    private int adSpaceHeight;

    private String adSpaceRatio;

    private int minDuration;

    private int maxDuration;

    private String ua;

    private String ip;

    private String imei;

    private String mac;

    private String mac1;

    private String idfa;

    private String aaid;

    private String androidId;

    private String udid;

    private String duid;

    private String visitorId;

    private int muniqueType;

    private String muniqueId;

    private int mob_ops;

    private String brand;

    private String model;

    private int os;

    private String osVersion;

    private int connType;

    private int deviceType;

    private int screenWidth;

    private int screenHeight;

    private int screenOritent;

    private float latitude;

    private float longitude;

    private int countryId;

    private int stateId;

    private int cityId;

    private int areaId;

    private String browser;

    private int campaignId;

    private long strategyId;

    private long creativeId;

    private int templateId;

    private long materialId;

    private int flag;

    private String guid;

    /**
     * 0:未转发
     * 1:转发成功
     * 2:转发失败
     */
    private int forwardType;

    private String imeiori;

    private String macori;

    private String idfaori;

    private String anidori;
    
	/**
	 * 备用的Os。
	 * 取自ad_space表中os字段。
	 */
	private int secondOs;

    /**
     * 一次请求的广告个数
     */
	private int pageSize;

    private String referer;

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public String getReferer() {
        return referer;
    }

    public void setReferer(String referer) {
        this.referer = referer;
    }

    public int getSecondOs() {
		return secondOs;
	}

	public void setSecondOs(int secondOs) {
		this.secondOs = secondOs;
	}

    public String getImeiori() {
        return imeiori;
    }

    public void setImeiori(String imeiori) {
        this.imeiori = imeiori;
    }

    public String getMacori() {
        return macori;
    }

    public void setMacori(String macori) {
        this.macori = macori;
    }

    public String getIdfaori() {
        return idfaori;
    }

    public void setIdfaori(String idfaori) {
        this.idfaori = idfaori;
    }

    public String getAnidori() {
        return anidori;
    }

    public void setAnidori(String anidori) {
        this.anidori = anidori;
    }

    public int getForwardType() {
        return forwardType;
    }

    public void setForwardType(int forwardType) {
        this.forwardType = forwardType;
    }

    public long getMaterialId() {
        return materialId;
    }

    public void setMaterialId(long materialId) {
        this.materialId = materialId;
    }

    public String getServerId() {
        return serverId;
    }

    public void setServerId(String serverId) {
        this.serverId = serverId;
    }

    /**
	 * @return the requestTimestamp
	 */
	public long getRequestTimestamp() {
		return requestTimestamp;
	}

	/**
	 * @param requestTimestamp the requestTimestamp to set
	 */
	public void setRequestTimestamp(long requestTimestamp) {
		this.requestTimestamp = requestTimestamp;
	}

	public float getVersion() {
        return version;
    }

    public void setVersion(float version) {
        this.version = version;
    }

    public String getRequestIp() {
        return requestIp;
    }

    public void setRequestIp(String requestIp) {
        this.requestIp = requestIp;
    }

    public long getAdSpaceId() {
        return adSpaceId;
    }

    public void setAdSpaceId(long adSpaceId) {
        this.adSpaceId = adSpaceId;
    }

    public int getMediaCategory() {
        return mediaCategory;
    }

    public void setMediaCategory(int mediaCategory) {
        this.mediaCategory = mediaCategory;
    }

    public int getAdFormat() {
        return adFormat;
    }

    public void setAdFormat(int adFormat) {
        this.adFormat = adFormat;
    }

    public int getAdSpaceWidth() {
        return adSpaceWidth;
    }

    public void setAdSpaceWidth(int adSpaceWidth) {
        this.adSpaceWidth = adSpaceWidth;
    }

    public int getAdSpaceHeight() {
        return adSpaceHeight;
    }

    public void setAdSpaceHeight(int adSpaceHeight) {
        this.adSpaceHeight = adSpaceHeight;
    }

    public String getAdSpaceRatio() {
        return adSpaceRatio;
    }

    public void setAdSpaceRatio(String adSpaceRatio) {
        this.adSpaceRatio = adSpaceRatio;
    }

    public int getMinDuration() {
        return minDuration;
    }

    public void setMinDuration(int minDuration) {
        this.minDuration = minDuration;
    }

    public int getMaxDuration() {
        return maxDuration;
    }

    public void setMaxDuration(int maxDuration) {
        this.maxDuration = maxDuration;
    }

    public String getUa() {
        return ua;
    }

    public void setUa(String ua) {
        this.ua = ua;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getImei() {
        return imei;
    }

    public void setImei(String imei) {
        this.imei = imei;
    }

    public String getMac() {
        return mac;
    }

    public void setMac(String mac) {
        this.mac = mac;
    }

    public String getMac1() {
        return mac1;
    }

    public void setMac1(String mac1) {
        this.mac1 = mac1;
    }

    public String getIdfa() {
        return idfa;
    }

    public void setIdfa(String idfa) {
        this.idfa = idfa;
    }

    public String getAaid() {
        return aaid;
    }

    public void setAaid(String aaid) {
        this.aaid = aaid;
    }

    public String getAndroidId() {
        return androidId;
    }

    public void setAndroidId(String androidId) {
        this.androidId = androidId;
    }

    public String getUdid() {
        return udid;
    }

    public void setUdid(String udid) {
        this.udid = udid;
    }

    public String getDuid() {
        return duid;
    }

    public void setDuid(String duid) {
        this.duid = duid;
    }

    public String getVisitorId() {
        return visitorId;
    }

    public void setVisitorId(String visitorId) {
        this.visitorId = visitorId;
    }

    public int getMuniqueType() {
        return muniqueType;
    }

    public void setMuniqueType(int muniqueType) {
        this.muniqueType = muniqueType;
    }

    public String getMuniqueId() {
        return muniqueId;
    }

    public void setMuniqueId(String muniqueId) {
        this.muniqueId = muniqueId;
    }

    public int getMob_ops() {
        return mob_ops;
    }

    public void setMob_ops(int mob_ops) {
        this.mob_ops = mob_ops;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public String getModel() {
        return model;
    }

    public void setModel(String model) {
        this.model = model;
    }

    public int getOs() {
        return os;
    }

    public void setOs(int os) {
        this.os = os;
    }

    public String getOsVersion() {
        return osVersion;
    }

    public void setOsVersion(String osVersion) {
        this.osVersion = osVersion;
    }

    public int getConnType() {
        return connType;
    }

    public void setConnType(int connType) {
        this.connType = connType;
    }

    public int getDeviceType() {
        return deviceType;
    }

    public void setDeviceType(int deviceType) {
        this.deviceType = deviceType;
    }

    public int getScreenWidth() {
        return screenWidth;
    }

    public void setScreenWidth(int screenWidth) {
        this.screenWidth = screenWidth;
    }

    public int getScreenHeight() {
        return screenHeight;
    }

    public void setScreenHeight(int screenHeight) {
        this.screenHeight = screenHeight;
    }

    public int getScreenOritent() {
        return screenOritent;
    }

    public void setScreenOritent(int screenOritent) {
        this.screenOritent = screenOritent;
    }

    public float getLatitude() {
        return latitude;
    }

    public void setLatitude(float latitude) {
        this.latitude = latitude;
    }

    public float getLongitude() {
        return longitude;
    }

    public void setLongitude(float longitude) {
        this.longitude = longitude;
    }

    public int getCountryId() {
        return countryId;
    }

    public void setCountryId(int countryId) {
        this.countryId = countryId;
    }

    public int getStateId() {
        return stateId;
    }

    public void setStateId(int stateId) {
        this.stateId = stateId;
    }

    public int getCityId() {
        return cityId;
    }

    public void setCityId(int cityId) {
        this.cityId = cityId;
    }

    public int getAreaId() {
        return areaId;
    }

    public void setAreaId(int areaId) {
        this.areaId = areaId;
    }

    public String getBrowser() {
        return browser;
    }

    public void setBrowser(String browser) {
        this.browser = browser;
    }

    public int getCampaignId() {
        return campaignId;
    }

    public void setCampaignId(int campaignId) {
        this.campaignId = campaignId;
    }

    public long getStrategyId() {
        return strategyId;
    }

    public void setStrategyId(long strategyId) {
        this.strategyId = strategyId;
    }

    public long getCreativeId() {
        return creativeId;
    }

    public void setCreativeId(long creativeId) {
        this.creativeId = creativeId;
    }

    public int getTemplateId() {
        return templateId;
    }

    public void setTemplateId(int templateId) {
        this.templateId = templateId;
    }

    public int getFlag() {
        return flag;
    }

    public void setFlag(int flag) {
        this.flag = flag;
    }

    public String getGuid() {
        return guid;
    }

    public void setGuid(String guid) {
        this.guid = guid;
    }

    public Object clone() {
        AdContext context = null;

        try {
            context = (AdContext)super.clone();
        } catch (CloneNotSupportedException e) {

        }

        return context;

    }

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "AdContext [serverId=" + serverId + ", requestTimestamp=" + requestTimestamp + ", version=" + version
				+ ", requestIp=" + requestIp + ", adSpaceId=" + adSpaceId + ", mediaCategory=" + mediaCategory
				+ ", adFormat=" + adFormat + ", adSpaceWidth=" + adSpaceWidth + ", adSpaceHeight=" + adSpaceHeight
				+ ", adSpaceRatio=" + adSpaceRatio + ", minDuration=" + minDuration + ", maxDuration=" + maxDuration
				+ ", ua=" + ua + ", ip=" + ip + ", imei=" + imei + ", mac=" + mac + ", mac1=" + mac1 + ", idfa=" + idfa
				+ ", aaid=" + aaid + ", androidId=" + androidId + ", udid=" + udid + ", duid=" + duid + ", visitorId="
				+ visitorId + ", muniqueType=" + muniqueType + ", muniqueId=" + muniqueId + ", mob_ops=" + mob_ops
				+ ", brand=" + brand + ", model=" + model + ", os=" + os + ", osVersion=" + osVersion + ", connType="
				+ connType + ", deviceType=" + deviceType + ", screenWidth=" + screenWidth + ", screenHeight="
				+ screenHeight + ", screenOritent=" + screenOritent + ", latitude=" + latitude + ", longitude="
				+ longitude + ", countryId=" + countryId + ", stateId=" + stateId + ", cityId=" + cityId + ", areaId="
				+ areaId + ", browser=" + browser + ", campaignId=" + campaignId + ", strategyId=" + strategyId
				+ ", creativeId=" + creativeId + ", templateId=" + templateId + ", materialId=" + materialId + ", flag="
				+ flag + ", guid=" + guid + "]";
	}
}
